var form;
var $;
var table;
var layer;
layui.use(['form','jquery','table','layer'],function() {
    form = layui.form;
    $ = layui.$;
    table = layui.table;
    layer = layui.layer;
});
var user = JSON.parse(localStorage.getItem('user'));

$.ajax({
    url:'/ProductOrder/getProduct',
    dataType:'json',
    data:{"productId":$('#proId',window.parent.document).val()},
    success:function (data) {
        data = data.data;
        $('input[name = productCode]').val(data[0].productCode);
        $('input[name = productName]').val(data[0].productName);
        $('input[name = currentpriceProduct]').val("￥"+data[0].currentpriceProduct);
        $('input[name = title]').val(data[0].categroyTitle);
        if(data[0].result == 0){
            data[0].result = "已删除";
        }else if(data[0].result == 1){
            data[0].result = "上架";
        }else{
            data[0].result = "下架";
        }
        $('input[name = result]').val(data[0].result);
        $('input[name = label]').val(data[0].productLabel);
        $('input[name = searchKeywords]').val(data[0].searchKeywords);
        $('input[name = hits]').val(data[0].hits);
        //$('input[name = createDate]').val(data[0].createDate);
        $('#productDescription').val(data[0].productDescription);
        $('#mainImage').html('<img src='+data[0].mainImage+' style="float:left; width:120px;"/>');
    }
});